#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    , currentContent(nullptr)
{
    ui->setupUi(this);

//    AuthDialog* ad = new AuthDialog(this);
//    ad->exec();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::setCurrentContent()
{
    if (currentContent)
        delete currentContent;

    try {
        currentContent = new EvaluationWidget(this);
    }  catch (const std::exception &e) {
        QMessageBox::critical(nullptr, "Error", QString("Exception caught: %1").arg(e.what()));

    } catch (...) {
        QMessageBox::critical(nullptr, "Error", "Unknown exception caught");
    }

    setCentralWidget(currentContent);
}



